package com.dayaokeji.rhythmschoolstudent.client.common.exam.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayaokeji.rhythmschoolstudent.R;
import com.dayaokeji.rhythmschoolstudent.client.common.base.common.ApiConstantKt;
import com.dayaokeji.rhythmschoolstudent.glide.GlideUrlModel;
import com.dayaokeji.rhythmschoolstudent.glide.GlideUtils;

import java.util.List;

/**
 * Created by Gorden on 2018/5/5.
 */
public class SubjectImgAdapter extends BaseQuickAdapter<Integer,BaseViewHolder> {

    public SubjectImgAdapter(List<Integer> integers) {
        super(R.layout.item_subject_choose_item_img, integers);
    }

    public SubjectImgAdapter() {
        super(R.layout.item_subject_choose_item_img, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, Integer item) {
        final ImageView imageView = (ImageView) helper.getView(R.id.iv_subject_choose_item_img);
        if (item != null) {
            GlideUtils.with(mContext).load(new GlideUrlModel(ApiConstantKt.getRemoteImageUrl()+ item)).into(imageView);
        }
    }
}
